def slide_in_bounce(t, start, duration, end_index):
    if start is None:
        start = 0
    if t < 10 * duration / 11 + start:
        if 11 * end_index * (t - start) / (9 * duration) < 0:
            return -141
        else:
            return 11 * end_index * (t - start) / (9 * duration)
    elif t > duration + start:
        return end_index
    else:
        return -11 * end_index * (t - start) / (9 * duration) + (20 * end_index / 9)
